#ifndef KCOMBOBOXWIDGET_H
#define KCOMBOBOXWIDGET_H

#include "../screencapsdk_global.h"
#include <QWidget>
#include <QLabel>
#include <QToolButton>

namespace kdk {

/**
 * @brief 可选择多个或者单个选项
 * @since 2.5
 */
class KComboBoxWidgetPrivate;
class KComboBoxWidget : public QWidget
{
    Q_OBJECT
public:
    KComboBoxWidget(QWidget *parent = nullptr);

    /**
     * @brief 设置combobox的选项列表
     * @param list
     */
    void setStringList(QStringList list);

    /**
     * @brief 获取选中的列表
     * @return
     */
    QStringList getChosenList();

    /**
     * @brief 设置主文本
     * @param text
     */
    void setMainText(QString text);

    /**
     * @brief 获取弹出菜单
     * @return
     */
    QMenu *menu();
protected:
    void mouseReleaseEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void leaveEvent(QEvent *e);
    void enterEvent(QEvent *e);
    void paintEvent(QPaintEvent *event);
signals:
    void comBoxWidgetClicked();

private:
    KComboBoxWidgetPrivate* const d_ptr;
    Q_DECLARE_PRIVATE(KComboBoxWidget)
};
}

#endif // KCOMBOBOXWIDGET_H
